#pragma once
#include <iostream>
#include "entry.h"

namespace VirtualR {

#define RED "\033[31m"                   /* Red */
#define GREEN "\033[32m"                 /* Green */
#define YELLOW "\033[33m"                /* Yellow */
#define BLUE "\033[34m"                  /* Blue */
#define WARNING_BACKGROUND "\033[43;31m" /* Yellow background, Red font */
#define END "\033[0m"

inline std::string to_4_bit(uint32_t value) {
  std::string res;
  res += static_cast<unsigned char>(value >> 24);
  res += static_cast<unsigned char>(value >> 16);
  res += static_cast<unsigned char>(value >> 8);
  res += static_cast<unsigned char>(value);
  return res;
}
std::vector<Entry_t> compact(std::vector<std::vector<Entry_t>> inputs);
std::vector<Entry_t> do_merge(std::vector<Entry_t> input1, std::vector<Entry_t> input2);

constexpr uint32_t MEM_MAX_SIZE = 2 * 1024 * 1024;
constexpr uint32_t TOTAL_LEVEL = 7;
constexpr uint64_t LEVEL_SIZE[7] = {5 * 1024 * 1024, 10 * 1024 * 1024, 100 * 1024 * 1024, 1000 * 1024 * 1024,
                                     10000 * 1024 * 1024L, 100000 * 1024 * 1024L};
const std::string LEVEL_NAME[7] = { "VLevel0", "VLevel1", "VLevel2", "VLevel3", "VLevel4", "VLevel5", "VLevel6"};

} // namespace VirtualR